package avicit.bdp.oss.utils.common;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-11-12
 * @类说明：AcitonEnum
 * @修改记录：
 * @注意事项：
 * @主要功能：Rest接口动作
 */
public enum AcitonEnum {
    MAKE_BUCKET("MakeBucket", "创建桶"),
    GET_BUCKET("GetBucket", "查询桶"),
    REMOVE_BUCKET("RemoveBucket", "删除桶"),
    UPDATE_BUCKET_STRATEGY("UpdateBucketStrategy", "修改桶策略"),
    ADD_BUCKET_AUTH("AddBucketAuth", "添加桶授权信息"),
    UPDATE_BUCKET_AUTH("UpdateBucketAuth", "修改桶授权信息"),
    GET_BUCKET_AUTH("GetBucketAuth", "查询桶授权信息"),
    DELTE_BUCKET_AUTH("DeleteBucketAuth", "删除桶授权信息"),
    MAKE_DIRECTORY("MakeDirectory", "创建目录"),
    PUT_OBJECT("PutObject", "上传对象"),
    REPEAT_PUT_OBJECT("RepeatPutObject", "重复上传对象"),
    GET_OBJECT("GetObject", "获取对象"),
    LIST_OBJECTS("ListObjects", "列举对象"),
    REMOVE_OBJECT("RemoveObject", "删除对象"),
    SHARE_OBJECT("ShareObject", "分享对象"),
    STAT_OBJECT("StatObject", "获取对象元数据信息"),
    GET_SYS_STATS_INFO("GetSysStats", "获取OSS对象存储系统概览信息"),
    GET_BUCKET_STORAGE_STATS("GetBucketStorageStats", "获取Bucket存量统计信息"),
    GET_BUCKET_METRIC_STATS("GetBucketMetricStats", "获取Bucket指标统计信息");

    private String action;

    private String desc;

    private AcitonEnum(String action, String desc) {
        this.action = action;
        this.desc = desc;
    }

    public String getAction() {
        return action;
    }

    public static AcitonEnum getActionType(String type) {
        for (AcitonEnum t : AcitonEnum.values()) {
            if (t.getAction().equals(type)) {
                return t;
            }
        }

        return null;
    }
}
